import request from './request';
var getMovieList =(type,page)=>{
   return request.get(`/gateway?cityId=510100&pageNum=${page}&pageSize=10&type=${type}&k=647220`,{
      data:{
         'X-Host':'mall.film-ticket.film.list',
      }
   })
}
var getMovieDetail = (id)=>{
   return request.get(`/gateway?filmId=${id}&k=8736720`,{
      data:{
         'X-Host':'mall.film-ticket.film.info'
      }
   })
}
var getSlide =()=>{
   return request.get('/gateway?type=2&cityId=110100&k=1984358',{
      data:{
         'X-Host':'mall.cfg.common-banner'
      }
   })
}
var getCityList=()=>{
   return request.get("/gateway?k="+Date.now(),
   {
     data:{
       'X-Host':"mall.film-ticket.city.list"
     }
   })
 }

var getCinema =(cid)=>{
   return request.get(`/gateway?cityId=${cid}&ticketFlag=1&k=1717756`,{
      data:{
         'X-Host':'mall.film-ticket.cinema.list'
      }
   })
}

var getCinemaDetail =(id)=>{
   return request.get(`/gateway/?cinemaId=${id}&k=9865740`,{
      data:{
         'X-Host':'mall.film-ticket.cinema.info'
      }
   })
}
var getCinemafilms=(id)=>{
   return request.get(`/gateway/?cinemaId=${id}&k=1951928`,{
      data:{
         'X-Host':'mall.film-ticket.film.cinema-show-film'
      }
   })
}
var getNews=()=>{
   return request.get('/gateway?actId=ElzMZU125260',{
      data:{
         'X-Host':'mall.act.static-page.info'
      }
   })
}
var getSchedule=(filmid,cid,date)=>{
   return request.get(`/gateway/?filmId=${filmid}&cinemaId=${cid}&date=${date}&k=4770680`,{
      data:{
         'X-Host':'mall.film-ticket.schedule.list'
      }
   })
}
var getfilmShowCinema=(fid,cid)=>{
   return request.get(`/gateway/?filmId=${fid}&cityId=${cid}&k=8440329`,{
      data:{
         'X-Host':'mall.film-ticket.cinema.film-show-cinema'
      }
   })
}
var getCinemalist = (cid, list) => {
   return request.post("/gateway?k=6183498", {
       "cityId": `${cid}`,
       "cinemaIds": `${list}`
   }, {
       data: {
           "X-Host": "mall.film-ticket.cinema.batch-cinema",

       }
   })
}
var getCode=(phone)=>{
   return request.post("/gateway",{
      "imgCode": "",
      "imgKey": "",
      "mobile": `${phone}`,
      "type":"1"
   },{
      data:{
         "X-Host": "mall.user.sms-code.send"
      }
   })
}
var getSeat = (sid)=>{
   return request.get(`/gateway/?scheduleId=${sid}&k=6098192`,{
      data:{
         'X-Host': 'mall.film-ticket.seat.list'
      }
   })
}
var getSeatOtherInfo = (sid)=>{
   return request.get(`/gateway/?scheduleId=${sid}&k=9964905`,{
      data:{
         'X-Host': 'mall.film-ticket.schedule.info'
      }
   })
}

export {
   getMovieList,
   getCinema,
   getSlide,
   getMovieDetail,
   getCityList,
   getCinemaDetail,
   getCinemafilms,
   getNews,
   getSchedule,
   getfilmShowCinema,
   getCinemalist,
   getCode,
   getSeat,
   getSeatOtherInfo
}